package web;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import biz.UserplusBiz;
import entity.Userplus;

public class SelectAllServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;       

    public SelectAllServlet() {
        super();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String curpage = request.getParameter("curpage");
		UserplusBiz biz = new UserplusBiz();
		int pageCount = biz.getPageCount();
		request.setAttribute("pageCount", pageCount);
		
		List<Userplus> list = biz.selectAll(Integer.parseInt(curpage));
		request.setAttribute("list", list);
		request.getRequestDispatcher("SelectUser.jsp").forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
